package com.xoa.service.attend;

import com.xoa.util.DateFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.util.Date;
@Service
@EnableScheduling
public class AttendScheduled {
    @Autowired
    private AttendService attendService;
    //@Scheduled(cron = "0/1 * * * * ? ")
    public synchronized void job1() {
        System.out.println(11111);
//        String date=DateFormat.getDatestr(new Date());
//        String beginDate=date+" 00:00:01";
//        String endDate=date+" 23:00:01";
       /* String beginDate="2019-04-01 00:00:01";
        String endDate="2019-04-23 23:00:01";
        synchronized (this){
            attendService.synAttend(beginDate,endDate);
        }*/

    }
}
